import request from '@/utils/request'
import myRequest from '@/utils/myRequest'
// import qs from 'qs'


export const drawbackAPI = (params = {}) => {
  return request.post('/hr/invoice/apply/taskBack', params)
}

export const getInvoiceTreeAPI = (params = {}) => {
  return request.get('/system/dict/invoice/treeselect', {
    params
  })
}

/**
 * 开票相关-获取列表 新增获取员工列表
 * 入参：hrInvoice 
 * 权限：hr:invoice:apply:list
 */
export const getPiaoListAPI = (params = {}) => {
  return request.get('/hr/invoice/apply/list', {
    params
  })
}

export const getPiaoListSummaryAPI = (params = {}) => {
  return request.get('/hr/invoice/summary/list', {
    params
  })
}


/**
 * 开票申请明细（单条）
 * method:GET
 * hr:invoice:apply:add
 * @returns {*}
 */
export const getPiaoListUpdateAPI = (params = {}) => {
  return request.get(`/hr/invoice/apply/${params.id}`, {})
}

/**
 * 开票相关-保存
 * 权限：hr:invoice:apply:add
 */
export const savePiaomakeAPI = (params = {}) => {
  return request.post('/hr/invoice/apply/save', params)
}

/**
 * 开票-管理列表-提交审批
 * 权限：hr:invoice:apply:add
 */
export const submitApproveAPI = (params = {}) => {
  return request.post(`/hr/invoice/apply/commit`, params)
}

/**
 * 开票-管理列表-删除开票申请
 * 权限：hr:invoice:apply:add
 */
export const deleteApproveAPI = (params = {}) => {
  return request.post(`/hr/invoice/apply/delete`, params)
}

